#ifndef FRAKOUTMIGRATIONCONTROLLER_H
#define FRAKOUTMIGRATIONCONTROLLER_H

#include <QList>

class FrakOutData;
class FrakOutVersion;
class FrakOutVersionState;

/**
 * A class for handling the migration of FrakOut! data from one version to
 * another.
 * @author cjr
 */
class FrakOutMigrationController
{
public:

    /**
     * Creates a migration controller object.
     */
    FrakOutMigrationController();

    /**
     * Destroys the version state objects.
     */
    ~FrakOutMigrationController();

    /**
     * Migrates the FrakOutData object from the start version to the end version.
     * @param frakOutData A reference to the object to be migrated.
     * @param startVersion The version of the object before migration begins.
     * @param endVersion The version to migrate to.
     */
    void migrate(FrakOutData& frakOutData,
                 const FrakOutVersion* const startVersion,
                 const FrakOutVersion* const endVersion);

private:

    /** A list of all FrakOutVersionState objects. */
    QList<FrakOutVersionState*> m_states;
};

#endif // FRAKOUTMIGRATIONCONTROLLER_H
